var t = getApp();

Page({
    data: {
        page: 1,
        videoList: [],
        isMore: !0,
        returnResult: !1
    },
    toDetail: function(t) {
        var e = t.currentTarget.dataset.room_id;
        wx.reLaunch({
            url: "/pages/live-video/video-detail/index?roomID=" + e
        }), console.log(t);
    },
    moreHouse: function() {
        wx.navigateTo({
            url: "/pages/list/list_house"
        });
    },
    getList: function() {
        var e = this;
        if (!e.data.isMore) return !1;
        wx.showLoading({
            title: "加载中"
        });
        var a = t.getMobSecret("/api/wechat/get-room-list", {
            uid: t.globalData.userInfo.user_id,
            page: this.data.page
        });
        wx.request({
            url: t.globalData.liveBase + "/api/wechat/get-room-list",
            data: a,
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                if (wx.hideLoading(), "0" == t.data.errorno) {
                    for (var a = t.data.data, i = 0; i < a.length; i++) e.data.videoList.push(a[i]);
                    e.setData({
                        isMore: !(a.length < 10),
                        videoList: e.data.videoList,
                        returnResult: !0
                    });
                }
            },
            fail: function(t) {
                reject(t);
            }
        });
    },
    onLoad: function(t) {},
    onReady: function() {},
    onShow: function() {
        this.setData({
            page: 1,
            videoList: [],
            isMore: !0
        }), null !== t.globalData.userInfo ? this.getList() : wx.redirectTo({
            url: "/pages/getinfo/index"
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        this.setData({
            page: 1,
            videoList: [],
            isMore: !0
        }), this.getList(), wx.stopPullDownRefresh(), wx.hideNavigationBarLoading();
    },
    onReachBottom: function() {
        if (!this.data.isMore) return !1;
        this.setData({
            page: this.data.page++
        }), this.getList();
    },
    onShareAppMessage: function() {}
});